package com.xuecheng.orders.service;

import com.xuecheng.messagesdk.model.po.MqMessage;
import com.xuecheng.orders.model.dto.AddOrderDto;
import com.xuecheng.orders.model.dto.PayRecordDto;
import com.xuecheng.orders.model.dto.PayStatusDto;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author shiminghui
 * @date 2024/9/14 15:51
 * @description: TODO
 */
public interface OrderService {
    /**
     * @param addOrderDto 订单信息
     * @return PayRecordDto 支付记录(包括二维码)
     * @description 创建商品订单
     * @author Mr.M
     * @date 2022/10/4 11:02
     */
    public PayRecordDto createOrder(String userId, AddOrderDto addOrderDto);

    /**
     * 扫码下单
     *
     * @param payNo
     * @param httpResponse
     */
    void requestpay(String payNo, javax.servlet.http.HttpServletResponse httpResponse);

    /**
     * 查询支付结果
     *
     * @param payNo
     * @return
     */
    PayRecordDto payresult(String payNo);

    /**
     * 保存支付信息
     *
     * @param payStatusDto
     */
    void saveAliPayStatus(PayStatusDto payStatusDto);

    /**
     * 接受支付结果通知
     *
     * @param request
     */
    void receivenotify(HttpServletRequest request);

    /**
     * 发送通知结果
     *
     * @param message
     */
    public void notifyPayResult(MqMessage message);
}
